import { PortalBaseSchema, PortalBaseSchemaRenderType, PortalBaseSchemaType, PortalProperty, PortalPropertyType } from "../../interface/template/declare";
import { BasePortalDefination } from "./BasePortalDefination";

export class EntryPortalSchema implements PortalBaseSchema {
  type: PortalBaseSchemaType;
  name: string;
  render?: PortalBaseSchemaRenderType | undefined;
  properties: PortalProperty[];

  constructor() {
    this.type = 'mutial'
    this.name = 'entry'
    this.render = 'icon'
    this.properties = [
      {
        title: '标题',
        type: PortalPropertyType.Text,
        name: 'title'
      },
      {
        title: '图标',
        type: PortalPropertyType.File,
        name: 'thumbnail'
      },

      {
        title: '链接',
        type: PortalPropertyType.Link,
        name: 'link'
      }
    ]
  }
}


export class EntryPortalDefination extends BasePortalDefination {
  schema: EntryPortalSchema;
  name: string;
  link: string
  constructor() {
    super()
    this.title = '快捷导航'
    this.schema = new EntryPortalSchema()
  }
}